]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
autorun: only obey allowAutorun flag for transient notifications
authorCosimo Cecchi <cosimoc@gnome.org>
Tue, 19 Jun 2012 19:06:44 +0000 (15:06 -0400)
committerCosimo Cecchi <cosimoc@gnome.org>
Wed, 20 Jun 2012 14:15:29 +0000 (10:15 -0400)
Only apply the allowAutorun flag for transient notifications, not for
mounts that end up in the resident notification well.

Also, stop looking at volume.can_automount() here, since we already
checked that previously in the mounter, and allowAutorun is enough.

https://bugzilla.gnome.org/show_bug.cgi?id=660595

js/ui/autorunManager.js

index 7283e16cd2d8aafc8e296af95bbfec01303a640d..be4eba2687c80007e2919a79da67123dce2e5c6e 100644 (file)
@@ -23,11 +23,11 @@ const AutorunSetting = {
 };
 
 // misc utils
-function shouldAutorunMount(mount) {
+function shouldAutorunMount(mount, forTransient) {
     let root = mount.get_root();
     let volume = mount.get_volume();
 
-    if (!volume || !volume.should_automount() || !volume.allowAutorun)
+    if (!volume || (!volume.allowAutorun && forTransient))
         return false;
 
     if (!root.is_native() || isMountRootHidden(root))
@@ -272,7 +272,7 @@ const AutorunResidentSource = new Lang.Class({
     },
 
     addMount: function(mount, apps) {
-        if (!shouldAutorunMount(mount))
+        if (!shouldAutorunMount(mount, false))
             return;
 
         let filtered = this._mounts.filter(function (element) {
@@ -450,7 +450,7 @@ const AutorunTransientDispatcher = new Lang.Class({
             return;
 
         // if the mount doesn't want to be autorun, return
-        if (!shouldAutorunMount(mount))
+        if (!shouldAutorunMount(mount, true))
             return;
 
         let setting = this._getAutorunSettingForType(contentTypes[0]);